﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IPC.Communication.Framework.Core.IMessage
{
    public class DcsNanJingAutoMessage : INetMessage
    {
        public int ProtocolHeadBytesLength
        {
            get
            {
                return 6;
            }
        }

        public byte[] HeadBytes
        {
            get;
            set;
        }

        public byte[] ContentBytes
        {
            get;
            set;
        }

        public byte[] SendBytes
        {
            get;
            set;
        }

        public int GetContentLengthByHeadBytes()
        {
            byte[] expr_07 = this.HeadBytes;
            int? num = (expr_07 != null) ? new int?(expr_07.Length) : null;
            int protocolHeadBytesLength = this.ProtocolHeadBytesLength;
            bool flag = num.GetValueOrDefault() >= protocolHeadBytesLength & num.HasValue;
            int result;
            if (flag)
            {
                result = (int)this.HeadBytes[4] * 256 + (int)this.HeadBytes[5];
            }
            else
            {
                result = 0;
            }
            return result;
        }

        public bool CheckHeadBytesLegal(byte[] token)
        {
            return true;
        }

        public int GetHeadBytesIdentity()
        {
            return (int)this.HeadBytes[0] * 256 + (int)this.HeadBytes[1];
        }
    }
}
